package com.cmo.common.controller.pager;

import java.util.HashMap;
import java.util.Map;

import com.cmo.common.model.Pager;
import com.cmo.common.utils.ToolString;
import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Record;


public class PagerController extends Controller {

	Pager pager=new Pager();
	public void pager_name(){
		Map<String, Object> map=new HashMap<String, Object>();
		String ip=getPara("ip");
		if(ToolString.isBlank(ip)){
			map.put("return_code", "fail");
			map.put("return_msg", "获取ip失败");
			renderJson(map);
			return;
		}
		Record record= pager.findip(ip);
		if(null==record){
			map.put("return_code", "fail");
			map.put("return_msg", "失败");
			renderJson(map);
			return;
		}else{
			map.put("return_code", "success");
			map.put("return_msg", "成功");
			map.put("zsmc", record.get("display_name"));
			renderJson(map);
		}
		renderJson(map);
	}
}
